﻿<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection" />
    <title>店铺目标分析表</title>
    <!--使用phonegap框架时引入脚本一定要放在最上面----->
    <script type="text/javascript" charset="utf-8" src="js/phonegap-1.4.1.js"></script>
    <script src="js/jquery/jquery-1.8.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/config.js" type="text/javascript" charset="utf-8"></script>
    <link href="css/style.css" rel="stylesheet" type="text/css" charset="utf-8" />
    <link href="css/btnsty.css" rel="stylesheet" type="text/css" charset="utf-8" />
    <link href="css/editform.css" rel="stylesheet" type="text/css" charset="utf-8" />
    <link href="css/global.css" rel="stylesheet" type="text/css" charset="utf-8" />
    <script src="js/Toast.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8" src="js/barcodescanner.js"></script>
    <script src="js/laydate.js" type="text/javascript"></script>
    <script type="text/javascript" charset="utf-8">
        $(function () {
            laydate.skin('molv'); //切换皮肤，请查看skins下面皮肤库
            //ClearData();
            GetStockList();
            $("#btnfind").live("click", function () {
                if ($("#shoplist option:checked").val() == "0") {
                    showtoast("请选择店铺！", null, 100, 100);
                    return;
                }
                if ($("#txtdate").val() == "") {
                    showtoast("请输入日期！", null, 100, 100);
                    return;
                }
                GetData();
            });
        });
        function ClearData() {
            $("#daytargetamt").text("0");
            $("#saleamt").text("0");
            $("#cashamt").text("0");
            $("#bankamt").text("0");
            $("#salewcl").text("0");
            $("#salecount").text("0");
            $("#ldv").text("0");
            $("#kdj").text("0");
            $("#vipcount").text("0");
            $("#vipsaleamt").text("0");
            $("#vipsalezb").text("0");
            $("#fzsaleamt").text("0");
            $("#pjsaleamt").text("0");
            $("#weektargetamt").text("0");
            $("#zsaleamt").text("0");
            $("#zwcl").text("0");
            $("#targetmoney").text("0");
            $("#msaleamt").text("0");
            $("#mwcl").text("0");
            $("#viptotcount").text("0");
            $("#mvipzb").text("0");
            $("#vipmsaleamt").text("0");
        }
        function GetData() {
            $("#loading-mask").show();
            $.ajax({
                url: url_path + "/ajaxdata/ShopTarget.aspx",
                type: "POST",
                data: { aciton: 'GetTargetSaleByShopRpt', shopid: $('#shoplist option:selected').val(), finddate: $("#txtdate").val() },
                timeout: 30000,
                dataType: "text",
                success: function (data) {
                    var msg = $.trim(data);
                    if (msg == "NO_DATA") {
                        ClearData();
                        $("#loading-mask").hide();
                        showtoast("没有数据可显示！", null, null, null);
                    } else {
                        var orderObj = JSON.parse(msg);
                        for (var i = 0; i < orderObj.length; i++) {
                            $("#daytargetamt").text(orderObj[i].daytargetamt);
                            $("#saleamt").text(orderObj[i].saleamt);
                            $("#cashamt").text(orderObj[i].cashamt);
                            $("#bankamt").text(orderObj[i].bankamt);
                            $("#salewcl").text(orderObj[i].salewcl);
                            $("#salecount").text(orderObj[i].salecount);
                            $("#ldv").text(orderObj[i].ldv);
                            $("#kdj").text(orderObj[i].kdj);
                            $("#vipcount").text(orderObj[i].vipcout);
                            $("#vipsaleamt").text(orderObj[i].vipsaleamt);
                            $("#vipsalezb").text(orderObj[i].vipsalezb);
                            $("#fzsaleamt").text(orderObj[i].fzsaleamt);
                            $("#pjsaleamt").text(orderObj[i].pjsaleamt);
                            $("#weektargetamt").text(orderObj[i].weektargetamt);
                            $("#zsaleamt").text(orderObj[i].zsaleamt);
                            $("#zwcl").text(orderObj[i].zwcl);
                            $("#targetmoney").text(orderObj[i].targetmoney);
                            $("#msaleamt").text(orderObj[i].msaleamt);
                            $("#mwcl").text(orderObj[i].mwcl);
                            $("#viptotcount").text(orderObj[i].viptotcount);
                            $("#mvipzb").text(orderObj[i].mvipzb);
                            $("#vipmsaleamt").text(orderObj[i].vipmsaleamt);

                        }
                        $("#loading-mask").hide();
                    }
                },
                error: function () {
                    showtoast("通讯超时,请检查网络.", null, 100, 100);
                }
            });
        }
        function GetStockList() {
            USER_ID = localStorage.getItem("UserID");
            $.ajax({
                url: url_path + "/ajaxdata/Default.aspx",
                type: "POST",
                data: { aciton: 'GetStockList', userid: USER_ID },
                timeout: 30000,
                dataType: "text",
                success: function (data) {
                    var msg = $.trim(data);
                    if (msg == "NO_DATA") {
                        alert("您没有任何店仓权限，请联系管理员！");
                    } else {
                        var orderObj = JSON.parse(msg);
                        var html = "";
                        for (var i = 0; i < orderObj.length; i++) {
                            html += '<option value="' + orderObj[i].stockid + '">' + orderObj[i].stockname + '</option>'
                        }
                        $("#shoplist").html(html);
                        $("#shoplist").selectindex = 0;
                    }
                },
                error: function () {
                    showtoast("通讯超时,请检查网络.", null, 100, 100);
                }
            });
        }
    </script>
</head>
<body style="background: #efefef;">
    <div id="header" class="head">
        <div class="wrap">
            <i class=" menu_back2"><a href="index.html"></a></i>
            <div class="title">
                <span class="title_d">
                    <p>
                        店铺目标分析表</p>
                </span>
                <div class="clear">
                </div>
            </div>
        </div>
        <div class="logo_msk">
        </div>
    </div>
    <div id="container">
        <div id="content">
            <div style="position: relative; background: #fff; margin: 8px; border: 1px solid #ddd;">
                <ul class="input-group2">
                    <li><strong>店铺：</strong><hr />
                        <select id="shoplist">
                            <option value="0">数据加载中...</option>
                        </select></li>
                    <li><strong>日期：</strong><hr />
                        <input id="txtdate" class="laydate-icon" id="txtedate" value="" onclick="laydate({ elem: '#txtdate' });"
                            placeholder="点击选择日期"></li>
                    <li><strong>天气：</strong><hr />
                        <input type="text" placeholder="暂时无法获取天气" id="Text2" /></li>
                </ul>
            </div>
            <div class="mod_btns">
                <a id="btnfind" class="mod_btn bg_2" href="#">查询</a>
            </div>
            <div style="position: relative; background: #fff; margin: 8px; border: 1px solid #ddd;">
                <ul class="input-group2">
                    <li><strong>今日目标：</strong><span id="daytargetamt">0</span>元</li>
                    <li><strong>今日结算金额：</strong><span id="saleamt">0</span>元</li>
                    <li><strong>现金：</strong><span id="cashamt">0</span>元&nbsp;&nbsp;&nbsp; <strong>刷卡：</strong><span
                        id="bankamt">0</span>元</li>
                    <li><strong>今日达成占比：</strong><span id="salewcl">0</span>%</li>
                    <li><strong>今日客流量统计：</strong><span>暂无数据</span></li>
                    <li><strong>今日销售单量：</strong><span id="salecount">0</span>单</li>
                    <li><strong>今日连带率：</strong><span id="ldv">0</span>%</li>
                    <li><strong>今日客单价：</strong><span id="kdj">0</span>元</li>
                    <li><strong>今日新增VIP数量：</strong><span id="vipcount">0</span>位</li>
                    <li><strong>今日VIP销售金额：</strong><span id="vipsaleamt">0</span>元</li>
                    <li><strong>今日VIP销售占比：</strong><span id="vipsalezb">0</span>%</li>
                    <li><strong>今日服装实际销售金额：</strong><span id="fzsaleamt">0</span>元</li>
                    <li><strong>今日鞋配件实际销售金额：</strong><span id="pjsaleamt">0</span>元</li>
                    <li><strong>周目标：</strong><span id="weektargetamt">0</span>元</li>
                    <li><strong>周累计完成金额：</strong><span id="zsaleamt">0</span>元</li>
                    <li><strong>周完成率：</strong><span id="zwcl">0</span>%</li>
                    <li><strong>本月目标：</strong><span id="targetmoney">0</span>元</li>
                    <li><strong>月累计完成金额：</strong><span id="msaleamt">0</span>元</li>
                    <li><strong>月累计完成率：</strong><span id="mwcl">0</span>%</li>
                    <li><strong>店铺累计VIP数量：</strong><span id="viptotcount">0</span>位</li>
                    <li><strong>本月VIP销售金额：</strong><span id="vipmsaleamt">0</span>元</li>
                    <li><strong>本月VIP销售占比：</strong><span id="mvipzb">0</span>%</li>
                    <li><strong>汇报人：</strong><span>暂无数据</span></li>
                </ul>
            </div>
        </div>
    </div>
    <div id='loading-mask'>
        <div id="loading">
            <div class="loading-indicator">
                <img src="images/0504317.gif" width="48" height="48" />
                <br />
                <span id="loading-msg">数据加载中...</span>
            </div>
        </div>
    </div>
</body>
</html>
